package com.lihaozhe.userservice.dto;

/**
 * 用户数据传输对象
 * 用于在服务间传递用户信息
 *
 * @author 李昊哲
 * @version 1.0.0
 */
public class UserDTO {
  /**
   * 用户ID
   */
  private Long id;
  /**
   * 用户名
   */
  private String username;
  /**
   * 邮箱
   */
  private String email;
  /**
   * 电话
   */
  private String phone;
  /**
   * 地址
   */
  private String address;

  // 构造函数
  public UserDTO() {
  }

  public UserDTO(String username, String email, String phone, String address) {
    this.username = username;
    this.email = email;
    this.phone = phone;
    this.address = address;
  }

  public UserDTO(Long id, String username, String email, String phone, String address) {
    this.id = id;
    this.username = username;
    this.email = email;
    this.phone = phone;
    this.address = address;
  }

  // Getter和Setter方法
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  @Override
  public String toString() {
    return String.format("User{id=%d, username='%s',phone=%s, email='%s'}", id, username, phone, email);
  }
}
